import React from 'react';
import { NavLink, Switch, Route, Redirect } from 'react-router-dom';
import Home from './../views/home';
import Kind from './../views/kind';
import Cart from './../views/cart';
import User from './../views/user';
import Contacts from './../views/contacts';
import './main.scss';
function App() {
  return (
    <div className="container">
      <Switch>
        <Route path="/home" component = { Home } />
        <Route path="/kind" component = { Kind } />
        <Route path="/cart" component = { Cart } />
        <Route path="/user" component = { User } />
        <Route path="/contacts" component = { Contacts } />
        <Redirect path="/" exact to="/home" />
      </Switch>
      <footer className="footer">
        <ul>
          <NavLink to="/home" activeClassName="selected">
            <span className="iconfont iconpingguo"></span>
            <p>首页</p>
          </NavLink>
          <NavLink to="/kind" activeClassName="selected">
            <span className="iconfont iconleimupinleifenleileibie"></span>
            <p>分类</p>
          </NavLink>
          <NavLink to="/cart" activeClassName="selected">
            <span className="iconfont icongouwuche11"></span>
            <p>购物车</p>
          </NavLink>
          <NavLink to="/user" activeClassName="selected">
            <span className="iconfont iconwode"></span>
            <p>我的</p>
          </NavLink>
          <NavLink to="/contacts" activeClassName="selected">
            <span className="iconfont iconxinxi"></span>
            <p>联系人</p>
          </NavLink>
        </ul>
      </footer>
    </div>
  );
}

export default App;
